﻿using Vigenere.Models;

namespace Vigenere
{
    internal class Program
    {
        /// <summary>
        /// 维吉尼亚密码的加密和解密
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("请输入明文:");
            string plain = Console.ReadLine();
            Console.WriteLine("请输入密钥:");
            string key = Console.ReadLine();
            MyFunctions encrypt = new MyFunctions();
            encrypt.Plaintext = plain;
            encrypt.Key = key;
            encrypt.Encrypt(encrypt.Key);
            Console.WriteLine($"您的密文为：{encrypt.Ciphertext}\n");
            Console.WriteLine("是否对该密文进行解密，若要解密请按Enter键");
            Console.ReadKey();

            encrypt.Decrypt(encrypt.Key);
            Console.WriteLine($"您的明文为：{encrypt.Plaintext}");


        }
    }
}